import { useEffect } from 'react';
import { useWebsiteStore } from '@/store/useWebsiteStore';

// 该组件用于加载网站配置，无UI
const WebsiteConfigLoader: React.FC = () => {
  const { fetchConfig } = useWebsiteStore();

  useEffect(() => {
    fetchConfig();
    
    // 设置定时刷新，每小时更新一次配置
    const interval = setInterval(() => {
      fetchConfig();
    }, 60 * 60 * 1000);

    return () => clearInterval(interval);
  }, [fetchConfig]);

  return null;
};

export default WebsiteConfigLoader; 